# coding=utf-8
'''
Created on 2013-12-24

@author: sunxiang
'''
from wtforms import StringField, PasswordField, BooleanField, validators
from lib.forms import Form

class LoginForm(Form):
    name = StringField('Name', [
        validators.InputRequired(message = "必须填写用户名"),
        validators.Length(min = 3, message = "用户名长度过短（3-32个字符）"),
        validators.Length(max = 32, message = "用户名长度过长（3-32个字符）"),
    ]) 
    
    password = PasswordField('Password', [
        validators.InputRequired(message = "必须填写密码"),
        validators.Length(min = 6, message = "密码长度过短（6-64个字符）"),
        validators.Length(max = 64, message = "密码长度过长（6-64个字符）"),
    ])
    
    rememeberme = BooleanField() # TODO 暂时没有处理
    
class SignupForm(Form):
    signname = StringField('SignName', [
        validators.InputRequired(message = "必须填写用户名"),
        validators.Length(min = 3, message = "用户名长度过短（3-32个字符）"),
        validators.Length(max = 32, message = "用户名长度过长（3-32个字符）"),
    ]) 
    
    signemail =  StringField('SignEmail', [
        validators.InputRequired(message = "必须填写邮箱"),
        validators.Email(message = "邮箱不符合格式"),
    ]) 
    
    signpassword = PasswordField('SignPassword', [
        validators.InputRequired(message = "必须填写密码"),
        validators.Length(min = 6, message = "密码长度过短（6-64个字符）"),
        validators.Length(max = 64, message = "密码长度过长（6-64个字符）"),
    ])
    